const state = {
  // 可选的奖品池列表
  giftPondOptions: [],
  // 奖品池列表
  giftPondList: [],
  // 起始矿石数
  initialOre: 1000,
  // 抽奖耗费矿石数
  giftUsedOres: 22,
  // 奖品中奖概率
  consumables: 0,
  consume: 0,
  lotteryResults: []
};
export default {
  state,
  mutations: {
    SAVE_SETTINGS(state, payload) {
      state = { ...state, ...payload };
      console.log('SAVE_SETTINGS', state);
    },
    SAVE_COUNT_CONSUME(state, payload) {
      state.consume = payload?.consume || state.consume;
      state.consumables = payload?.consumables || state.consumables
    },
    SAVE_LOTTERY_RESULT(state, payload) {
      state = { ...state, ...payload }
    }

  },
  actions: {
    saveSettings({ commit }, payload) {
      commit('SAVE_SETTINGS', payload);
    },
    saveCountConsume({ commit }, payload) {
      commit("SAVE_COUNT_CONSUME", payload)
    },
    saveLotteryResult({ commit }, payload) {
      commit("SAVE_LOTTERY_RESULT", payload)
    }
  },
  getters: {},
}
